/*
 * @Author: JohnYang
 * @Date: 2020-09-22 20:57:03
 * @LastEditors: JohnYang
 * @LastEditTime: 2020-09-28 23:32:14
 */
const TokenKey = "Admin-Token";

const RefreshTokenKey = "Admin-Refresh-Token";

const ExpiresInKey = "Admin-Expires-In";

export function getToken() {
  return localStorage.getItem(TokenKey);
}

export function getEmail() {
  return localStorage.getItem("SET_EMAIL");
}

export function setToken(token) {
  return localStorage.setItem(TokenKey, token);
}

export function removeToken() {
  return localStorage.removeItem(TokenKey);
}

export function getRefreshToken() {
  return localStorage.getItem(RefreshTokenKey) || ``;
}

export function setRefreshToken(token) {
  return localStorage.setItem(RefreshTokenKey, token);
}

export function removeRefreshToken() {
  return localStorage.removeItem(RefreshTokenKey);
}

export function getExpiresIn() {
  return localStorage.getItem(ExpiresInKey) || -1;
}

export function setExpiresIn(time) {
  return localStorage.setItem(ExpiresInKey, time);
}

export function removeExpiresIn() {
  return localStorage.removeItem(ExpiresInKey);
}
